package com.joe.xl.demo.thread.cyclibarrier;

import java.util.concurrent.CyclicBarrier;
import java.util.concurrent.TimeUnit;

public class A extends Thread {
    private int a;
    private CyclicBarrier c;

    public A(int a, CyclicBarrier c){
        this.a = a;
        this.c = c;
    }

    @Override
    public void run() {
        System.out.println(a);
        try {
            TimeUnit.SECONDS.sleep(1);
            c.await();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println("end--" + a);
    }
}
